package com.weifeng.jdsignin.readexcel;

import com.alibaba.excel.EasyExcel;
import com.weifeng.jdsignin.log.ConfigLog;
import org.apache.log4j.Logger;

import java.io.FileNotFoundException;
import java.util.List;

/**
 * @description：读取excel
 * @USER ：weifeng
 * @date ：2022/11/11 下午 02:35
 */
public class Readuseruntity extends ConfigLog{
    private static String filename = "C:\\Users\\Administrator\\Desktop\\user.xlsx";
    private static Logger logger = Logger.getLogger(Readuseruntity.class);

    public static void main(String[] args) throws FileNotFoundException {
        read();
    }

    public static List<Useruntity> read()  {
        List<Useruntity> userlist =
                EasyExcel.read(filename, Useruntity.class, null).sheet().headRowNumber(1).doReadSync();
        logger.info("excel "+filename+" 读取完成！");
        return userlist;

    }
}
